import pandas as pd

df = pd.read_csv('aaa.csv',
                 names=['时间', '数量'],  # 列名
                 index_col='时间',  # 索引列
                 parse_dates=['时间']
                 )

df = df.resample('s').count()

for i in df.index:
    print(i, df['数量'].at[i])
